home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Sound / SoundApp / SoundApp.r < prev    next >
Encoding:
Text File  |  1997-02-18  |  43.7 KB  |  1,025 lines  |  [TEXT/MPS ]

  1. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. /*
  3. Apple Macintosh Developer Technical Support
  4.  
  5. MultiFinder-Aware SoundApp Application
  6.  
  7. SoundApp
  8.  
  9. SoundApp.r    -    Rez Source
  10.  
  11. Jim Reekes - Macintosh Developer Technical Support
  12. Copyright © 1989-1994 Apple Computer, Inc.
  13. All rights reserved.
  14.  
  15. Versions:
  16.         1.03                January, 1990
  17.         1.04                Sept, 1990
  18.         1.2                    August, 1994        translated to C
  19.  
  20. Components:
  21.         SoundApp.c            January, 1990        MPW C source code
  22.         SoundUnit.c            January, 1990        MPW C source code
  23.         SoundUnit.h            January, 1990        MPW C source code
  24.         SoundApp.r            January, 1990        MPW Rez source code
  25.         SoundAppSnds.r        January, 1990        MPW Rez source code
  26.         SoundApp.make        January, 1990        MPW build script
  27.  
  28. Formatting was done with FONT = Courier or Monaco, SIZE = 10, TABS = 4
  29.  
  30. SoundApp.p is a sample application source file for demonstrating
  31. the Sound Manager.  It requires the use of the SoundUnit to handle
  32. all of the sound routines.  This portion of the source code handles the
  33. application’s management of memory, errors, user interface, etc..
  34.  
  35. Jim Reekes E.O., Macintosh Developer Technical Support
  36. Sunday, August 7, 1994 7:06:41 PM
  37. */
  38. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39.  
  40. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. // INCLUDES
  42. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43.  
  44. #include "Types.r"
  45. #include "SysTypes.r"
  46.  
  47. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. // CONSTANTS
  49. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50.  
  51. // These #defines are used to set enable/disable flags of a menu
  52. #define AllItems        0b1111111111111111111111111111111    /* 31 bits worth of flags */
  53. #define NoItems            0b0000000000000000000000000000000
  54. #define MenuItem1        0b0000000000000000000000000000001
  55. #define MenuItem2        0b0000000000000000000000000000010
  56. #define MenuItem3        0b0000000000000000000000000000100
  57. #define MenuItem4        0b0000000000000000000000000001000
  58. #define MenuItem5        0b0000000000000000000000000010000
  59. #define MenuItem6        0b0000000000000000000000000100000
  60. #define MenuItem7        0b0000000000000000000000001000000
  61. #define MenuItem8        0b0000000000000000000000010000000
  62. #define MenuItem9        0b0000000000000000000000100000000
  63. #define MenuItem10        0b0000000000000000000001000000000
  64. #define MenuItem11        0b0000000000000000000010000000000
  65. #define MenuItem12        0b0000000000000000000100000000000
  66.  
  67.  
  68. /* These values are used in SIZE resource. */
  69.  
  70. #define kMinSize            150        /*application’s minimum size (in K)*/
  71. #define kPrefSize            300        /*application’s preferred size (in K)*/
  72.  
  73. /* This is the standard amount of white pixels around the inside edge of dialogs. */
  74.  
  75. #define kStandardWhiteSpacing 13
  76.  
  77. /* static text and edit text items height */
  78.  
  79. #define kStandardTextHeight    16
  80.  
  81. /* This is the rectangle of where to place the icon in an alert. */
  82.  
  83. #define kStdAlertIconTop    kStandardWhiteSpacing
  84. #define kStdAlertIconLeft    23
  85. #define kIconWidthOrHeight    32
  86.  
  87. #define kStdAlertIconRect    {kStdAlertIconTop, kStdAlertIconLeft, kStdAlertIconTop+kIconWidthOrHeight, kStdAlertIconLeft+kIconWidthOrHeight}
  88.  
  89. /* These constants are the size of a standard button and the default button.*/
  90.  
  91. #define kButtonFrameInset    -4        /* inset rectangle adjustment around button */
  92. #define kButtonSizeW        59
  93. #define kButtonSizeH        20
  94. #define kDafaultButSizeW    (kButtonSizeW - kButtonFrameInset - kButtonFrameInset)
  95. #define kDafaultButSizeH    (kButtonSizeH - kButtonFrameInset - kButtonFrameInset)
  96.  
  97. /* These constants are used in defining the size of the application’s windows.
  98.    All of the following windows are dymanically positioned on screen by
  99.     the application.  These values will change the height and width of the windows. */
  100.  
  101. #define kExitAlertSizeH        136
  102. #define kExitAlertSizeW        248
  103. #define kUserAlertSizeH        129
  104. #define kUserAlertSizeW        304
  105. #define kSoundVolSizeH        110
  106. #define kSoundVolSizeW        278
  107. #define kAboutWindowSizeH    232
  108. #define kAboutWindowSizeW    336
  109. #define kStatusWindowSizeH    103
  110. #define kStatusWindowSizeW    240
  111. #define kGetNameDialogSizeH    112
  112. #define kGetNameDialogSizeW 254
  113.  
  114.  
  115. /*
  116. Believe it or not, I found this complication to be very useful.
  117. Normally, people tend to use ResEdit to change the layout of a window
  118. especially for dialogs.  I have a difficult time getting the pixels
  119. exactly right using ResEdit.  People said I could then DeRez the window
  120. and make the adjustments.  This was just a difficult.  I needed some
  121. scratch paper and a calculator.  After thinking about it, I wrote these
  122. definitions of my window’s geometry.  This ended up in a scheme that I
  123. found to be much more helpful in building the exact window I wanted.  The
  124. document window has all items spaced apart from each a consistent amount.
  125. The size of the items are consistent and spaced equally apart from each
  126. other.
  127.  
  128. VERSION 1.1:  The height of the window defaults NOT to show the last button
  129. which is used for recording.  Typically, I suspect that most of the time
  130. the Sound Input Manager will not be present.  Thus I'm going to hide the
  131. record button.  If the application determines that Sound Input is available
  132. then it resizes the window to show the record button.
  133. */
  134.  
  135. #define kNumOfButtons        6        /* the number of buttons in the window */
  136. #define kSndButtonSizeW        110        /* SizeW of buttons in document window */
  137. #define kSndButtonSizeH        22        /* heigth of buttons in document window */
  138. #define kSndListButGap        (16 + (2 * kStandardWhiteSpacing)) /* list’s scroll bar and more */
  139. #define kSoundWindowSizeH    ((kNumOfButtons * (kStandardWhiteSpacing + kSndButtonSizeH)) + kStandardWhiteSpacing)
  140. #define kSoundWindowSizeW    296
  141.  
  142. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. // RESOURCE ID NUMBERS
  144. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. // ALRT resources
  146. #define rExitAlert            1000        /*emergency exit user alert*/
  147. #define rUserAlert            1001        /*error message user alert*/
  148. #define rSoundVol            1002        /*volume too low message*/
  149. #define rSaveAlert            1003        /*save this document?*/
  150.  
  151. // DLOG resources
  152. #define rGetNameDLOG        2000        /*get name for sound dialog*/
  153. #define rCustomGetFileDLOG    2001        /*CustomGetFile dialog*/
  154.  
  155. // BNDL resource information
  156. #define rAppBundle            1000        /*application’s bundle resource ID*/
  157. #define rAppSignature         'SAPP'        /*applicaiton’s OS signature*/
  158. #define rSndAppDocType        'sDoc'        /*document's file type*/
  159.  
  160. // CNTL resources
  161. #define rCancelCntl            1000        /*button ID for the status window*/
  162. #define rPlaySndCntl        1001        /*button ID for the document window*/
  163. #define rHyperPlayCntl        1002        /*button ID for the document window*/
  164. #define rPlayScaleCntl        1003        /*button ID for the document window*/
  165. #define rPlayMelodyCntl        1004        /*button ID for the document window*/
  166. #define rStopCntl            1005        /*button ID for the document window*/
  167. #define rRecordCntl            1006        /*button ID for the document window*/
  168. #define rAboutOKCntl        1007        /*button ID for the about window*/
  169.  
  170. // CURS resources
  171. #define rSndCursor            1000        /*document cursor ID*/
  172. #define rACursor1            1001        /*animated cursor ID*/
  173. #define rACursor2            1002        /*animated cursor ID*/
  174. #define rACursor3            1003        /*animated cursor ID*/
  175. #define rACursor4            1004        /*animated cursor ID*/
  176.  
  177. // ICON resources
  178. #define rNoteIcon            1            /*the note icon*/
  179. #define rCautionIcon        2            /*the caution icon*/
  180. #define rMoofIcon            1000        /*application ID for all the icon types*/
  181. #define rSndDocIcon            1001        /*document ID for all the icon types*/
  182.  
  183. // MENU resources.  The following constants have a “m” prefix to notate they’re menus.
  184. #define rMenuBar            1000        /*application’s menu bar*/
  185. #define mApple                128            /*Apple menu*/
  186. #define mFile                129            /*File menu*/
  187. #define mEdit                130            /*Edit menu*/
  188. #define mDemos                1000        /*Demo menu*/
  189.  
  190. // PICT resources
  191. #define rAppPict            1000        /*picture appearing in about window*/
  192.  
  193. // RECT resources, custom made to order
  194. #define rListRectID            1000        /*size of list rectangle*/
  195.  
  196. // STR resources
  197. #define rUntitled            1000        /*string for untitled snd resources*/
  198. #define rAboutText            1001        /*string for text appearing in about window*/
  199. #define rPutFileMsg            1002        /*string for text appearing in SFPutFile dialog*/
  200.  
  201. // STR# resources.  The following constants have a “s” prefix to notate they’re strings.
  202. #define sErrStrings            1000        /*error strings STR# ID*/
  203. #define sMessStrings        1001        /*message strings STR# ID for status window*/
  204. #define sSMErrStrings        1002        /*message strings of Sound Manager errors*/
  205.  
  206. // WIND resources.  All windows used in the application need a unique resource ID.
  207. #define rAboutWindow        1000        /*about dialog*/
  208. #define rStatusWindow        1001        /*status window ID used to show current sound*/
  209. #define rSoundWindow        1002        /*sound document window ID*/
  210.  
  211.  
  212. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213. // RESOURCE DEFINITIONS
  214. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  215.  
  216. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  217.  This is the vers resource used by the Finder in the Get Info window.
  218.  I also display the short version number in the about window. */
  219.  
  220. resource 'vers' (1, purgeable) {
  221.     0x1, 0x20, beta, 0x1, verUs, "1.2b1", "1.2b1, Copyright © 1989-94 Apple Computer"
  222. };
  223.  
  224. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  225.  These are the resources used for the animated cursors.  They are preloaded
  226.  and non-purgeable to help reduce memory fragmentation. */
  227.  
  228. resource 'acur' (0, preload, nonPurgeable) {
  229.     {rACursor1, rACursor2, rACursor3, rACursor4}
  230. };
  231.  
  232. resource 'CURS' (rACursor1, preload, nonPurgeable) {
  233.     $"00 00 00 00 00 00 16 00 3E 01 54 03 C3 05 F3 FD"
  234.     $"08 FA 0C 72 0C 02 0D F2 0A 0A 0A 0A 0A 0A 1C 1E",
  235.     $"00 00 00 00 00 00 16 00 3E 01 7C 03 FF 07 FF FF"
  236.     $"0F FE 0F FE 0F FE 0F FE 0E 0E 0E 0E 0E 0E 1C 1E",
  237.     {4, 10}
  238. };
  239.  
  240. resource 'CURS' (rACursor2, preload, nonPurgeable) {
  241.     $"30 30 28 38 24 24 13 AC 0B C6 04 0C 02 36 02 36"
  242.     $"02 E0 02 E0 0E E0 10 60 26 20 29 90 28 50 30 38",
  243.     $"30 30 38 38 3C 3C 1F BC 0F FE 07 FC 03 F6 03 F6"
  244.     $"03 E0 03 E0 0F E0 1F E0 3F E0 39 F0 38 70 30 38",
  245.     {15, 7}
  246. };
  247.  
  248. resource 'CURS' (rACursor3, preload, nonPurgeable) {
  249.     $"00 00 06 C0 0A A0 12 90 14 58 17 D8 20 18 27 18"
  250.     $"4F 18 9F CF E0 C3 80 2A 00 FC 00 D0",
  251.     $"00 00 06 C0 0E E0 1E F0 1C 78 1F F8 3F F8 3F F8"
  252.     $"7F F8 FF FF E0 FF 80 3E 00 FC 00 D0",
  253.     {9, 6}
  254. };
  255.  
  256. resource 'CURS' (rACursor4, preload, nonPurgeable) {
  257.     $"0E 06 05 0A 04 CA 02 32 03 04 03 B8 03 A0 03 A0"
  258.     $"36 20 36 20 18 10 31 E8 1A E4 12 12 0E 0A 06 06",
  259.     $"0E 06 07 0E 07 CE 03 FE 03 FC 03 F8 03 E0 03 E0"
  260.     $"37 E0 37 E0 1F F0 3F F8 1E FC 1E 1E 0E 0E 06 06",
  261.     {6, 6}
  262. };
  263.  
  264. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265.  This is the cursor used when the cursor is over a sound document window. */
  266.  
  267. resource 'CURS' (rSndCursor, preload, nonPurgeable) {
  268.     $"03 80 04 C0 04 C0 04 C0 04 C0 04 C0 74 F8 9C AE"
  269.     $"4C AB 24 0B 24 03 10 03 08 03 08 06 04 06 04 06",
  270.     $"03 80 07 C0 07 C0 07 C0 07 C0 07 C0 77 F8 FF FE"
  271.     $"7F FF 3F FF 3F FF 1F FF 0F FF 0F FE 07 FE 07 FE",
  272.     {0, 7}
  273. };
  274.  
  275. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276.  These are the resources used to create the bungle package used by the Finder.
  277.  I use type coerson to create my signature string.  Many of these resources
  278.  have to do with the new Finder for System 7.0 and the desktop display, such
  279.  as the use of color icons. */
  280.  
  281. type rAppSignature as 'STR ';
  282.  
  283. resource rAppSignature (0, "Owner resource", purgeable) {
  284.     "SoundApp"
  285. };
  286.  
  287. resource 'BNDL' (rAppBundle, purgeable) {
  288.     rAppSignature, 0,
  289.     {
  290.         'ICN#', {0, rMoofIcon, 1, rSndDocIcon},
  291.         'FREF', {0, rMoofIcon, 1, rSndDocIcon},
  292.     }
  293. };
  294.  
  295. resource 'FREF' (rAppBundle, purgeable) {
  296.     'APPL', 0, ""
  297. };
  298.  
  299. resource 'FREF' (rSndDocIcon, purgeable) {
  300.     rSndAppDocType, 1, ""
  301. };
  302.  
  303. resource 'ICN#' (rMoofIcon, purgeable) {
  304.     {
  305. /* [1] */
  306.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  307.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  308.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  309.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  310.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  311.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  312.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  313.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  314. /* [2] */
  315.         $"0430 4000 0E70 E000 0FF1 F002 0FE3 F803"
  316.         $"1FE7 FC07 3FEF FE0F 7FFF FF1F FFFF FFBF"
  317.         $"FFFF FFFE 7FFF FFFC 01FF FFFC 03FF FFF8"
  318.         $"07FF FFFC 0FFF FFFE 1FFF FFFF 0FFF FFFE"
  319.         $"07FF FFFC 03FF FFFC 01FF FFFC 00FF FFFC"
  320.         $"00FF FFFC 00FF FFFC 01FF FFF8 03EF FFF0"
  321.         $"01C7 FCE0 0003 F800 73BF FBEE 7FBE FBEE"
  322.         $"7FBE FBEE 7FBE FBE4 7FBE FBEE 73BE FB8E"
  323.     }
  324. };
  325.  
  326. resource 'ICN#' (rSndDocIcon, purgeable) {
  327.     {
  328. /* [1] */
  329.         $"0000 0000 0000 0000 7FFF FFC0 4000 0060"
  330.         $"4000 0050 4E97 0048 48D4 807C 4EB4 8004"
  331.         $"4294 8004 4E97 0004 4000 0004 4000 0004"
  332.         $"4001 8204 4003 8104 4006 8884 400C 8444"
  333.         $"4018 8244 4030 9244 4FE0 9224 4800 8924"
  334.         $"4800 8924 4800 8924 4FE0 8924 4FF0 9224"
  335.         $"4038 9244 401C 8244 400E 8444 4007 8884"
  336.         $"4003 8104 4001 8204 4000 0004 7FFF FFFC",
  337. /* [2] */
  338.         $"0000 0000 0000 0000 7FFF FFC0 7FFF FFE0"
  339.         $"7FFF FFF0 7FFF FFF8 7FFF FFFC 7FFF FFFC"
  340.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  341.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  342.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  343.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  344.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  345.         $"7FFF FFFC 7FFF FFFC 7FFF FFFC 7FFF FFFC"
  346.     }
  347. };
  348.  
  349. resource 'icl4' (rMoofIcon, purgeable) {
  350.     $"0000 0F00 00FF 0000 0F00 0000 0000 0000"
  351.     $"0000 F0F0 0F0F 0000 F8F0 0000 0000 0000"
  352.     $"0000 F0FF F00F 000F 888F 0000 0000 00F0"
  353.     $"0000 F000 00F0 00F8 8888 F000 0000 00FF"
  354.     $"000F 00F0 00F0 0F88 8888 8F00 0000 0F0F"
  355.     $"00F0 0000 00F0 F888 8888 88F0 0000 F00F"
  356.     $"0F00 0000 000F 8888 8888 888F 000F 000F"
  357.     $"F000 0000 0000 FF88 8888 8888 F0F0 000F"
  358.     $"F000 0000 0000 00FF FFFF FFFF FF00 00F0"
  359.     $"0FFF FFF0 0000 0000 FFFF FFFF 0000 0F00"
  360.     $"0000 000F 0000 0000 0FFF FFFF 0000 0F00"
  361.     $"0000 00FF 0000 0000 000F FFF0 0000 F000"
  362.     $"0000 0F88 FFF0 0000 0000 0000 0000 FF00"
  363.     $"0000 F888 FFF0 0000 0000 0000 0000 F8F0"
  364.     $"000F 8888 FFF0 0000 0000 0000 0000 F88F"
  365.     $"0000 F888 FF00 0000 0000 0000 0000 0FF0"
  366.     $"0000 0F88 F000 0FFF FFFF FFF0 0000 0F00"
  367.     $"0000 00F8 F000 F888 8888 888F 0000 0F00"
  368.     $"0000 000F F000 F888 8888 8888 F000 0F00"
  369.     $"0000 0000 F000 F888 8888 8888 8F00 0F00"
  370.     $"0000 0000 F000 F888 8888 8888 8F00 0F00"
  371.     $"0000 0000 F000 F888 8888 8888 FF00 0F00"
  372.     $"0000 000F 000F 8888 8888 888F F000 F000"
  373.     $"0000 00F0 00F0 F888 8888 88FF 000F 0000"
  374.     $"0000 000F FF00 0F88 8888 8F00 FFF0 0000"
  375.     $"0000 0000 0000 00F8 8888 F000 0000 0000"
  376.     $"0FFF 00FF F0FF FFFF FFFF F0FF FFF0 FFF0"
  377.     $"0F33 FF33 F0F3 33F0 F333 F0F3 33F0 F3F0"
  378.     $"0F33 3333 F0F3 F3F0 F3F3 F0F3 FFF0 F3F0"
  379.     $"0F3F 33F3 F0F3 F3F0 F3F3 F0F3 33F0 0F00"
  380.     $"0F3F FFF3 F0F3 33F0 F333 F0F3 FFF0 F3F0"
  381.     $"0FFF 00FF F0FF FFF0 FFFF F0FF F000 FFF0"
  382. };
  383.  
  384. resource 'icl4' (rSndDocIcon, purgeable) {
  385.     $"0000 0000 0000 0000 0000 0000 0000 0000"
  386.     $"0000 0000 0000 0000 0000 0000 0000 0000"
  387.     $"0FFF FFFF FFFF FFFF FFFF FFFF FF00 0000"
  388.     $"0F00 0000 0000 0000 0000 0000 0FD0 0000"
  389.     $"0F00 0000 0000 0000 0000 0000 0FDD 0000"
  390.     $"0F00 FFF0 F00F 0FFF 0000 0000 0FDD D000"
  391.     $"0F00 F000 FF0F 0F00 F000 0000 0FFF FF00"
  392.     $"0F00 FFF0 F0FF 0F00 F000 0000 0000 0F00"
  393.     $"0F00 00F0 F00F 0F00 F000 0000 0000 0F00"
  394.     $"0F00 FFF0 F00F 0FFF 0000 0000 0000 0F00"
  395.     $"0F00 0000 0000 0000 0000 0000 0000 0F00"
  396.     $"0F00 0000 0000 0000 D000 0000 0000 0F00"
  397.     $"0F00 0000 0000 000F E000 00F0 0000 0F00"
  398.     $"0F00 0000 0000 00FE E000 000F 0000 0F00"
  399.     $"0F00 0000 0000 0FED C000 F000 F000 0F00"
  400.     $"0F00 0000 0000 FEDC C000 0F00 0F00 0F00"
  401.     $"0F00 0000 000F EDC0 C000 00F0 0F00 0F00"
  402.     $"0F00 0000 00FE DC00 D00F 00F0 0F00 0F00"
  403.     $"0F00 EFFF FFED C0CC D00F 00F0 00F0 0F00"
  404.     $"0F00 EDDD DDCC CCCC E000 F00F 00F0 0F00"
  405.     $"0F00 D000 00C0 CCCC E000 F00F 00F0 0F00"
  406.     $"0F00 ECCC CCDC CCCC E000 F00F 00F0 0F00"
  407.     $"0F00 FEEE EEEE DDDD E000 F00F 00F0 0F00"
  408.     $"0F00 FFFF FFEE EDDD F00F 00F0 00F0 0F00"
  409.     $"0F00 0000 00FE EEDD E00F 00F0 0F00 0F00"
  410.     $"0F00 0000 000F FEED F000 00F0 0F00 0F00"
  411.     $"0F00 0000 0000 FEEE E000 0F00 0F00 0F00"
  412.     $"0F00 0000 0000 0FFE F000 F000 F000 0F00"
  413.     $"0F00 0000 0000 00FE F000 000F 0000 0F00"
  414.     $"0F00 0000 0000 000F F000 00F0 0000 0F00"
  415.     $"0F00 0000 0000 0000 D000 0000 0000 0F00"
  416.     $"0FFF FFFF FFFF FFFF FFFF FFFF FFFF FF"
  417. };
  418.  
  419. resource 'ics4' (rMoofIcon, purgeable) {
  420.     $"00F0 0F00 FF00 0000 00F0 FF0F 88F0 000F"
  421.     $"0F0F 0FF8 888F 00FF F000 0FF8 8888 FF0F"
  422.     $"FFFF 000F FFFF F0FF 000F 0000 FFFF 00F0"
  423.     $"00F8 FF00 0000 00F0 0F88 FF00 0000 00FF"
  424.     $"00F8 F0FF FFFF 00F0 000F F0F8 8888 F0F0"
  425.     $"0000 F0F8 8888 F0F0 000F 0FF8 888F F0F0"
  426.     $"000F F00F 88F0 FF00 0000 0000 FF"
  427. };
  428.  
  429. resource 'ics4' (rSndDocIcon, purgeable) {
  430.     $"0000 0000 0000 0000 FFFF FFFF FFFF FF00"
  431.     $"F000 0000 0000 0FF0 F000 0000 0000 0FFF"
  432.     $"F000 0000 F000 000F F000 000F E00F 000F"
  433.     $"F000 00FE E000 F00F F000 0FED D0F0 0F0F"
  434.     $"F0FF FED0 D00F 0F0F F0FC CCCC D00F 0F0F"
  435.     $"F0FE EDDD D00F 0F0F F0FF FEDD E0F0 0F0F"
  436.     $"F000 0FEE E000 F00F F000 00FE E00F 000F"
  437.     $"F000 000F F000 000F FFFF FFFF FFFF FFFF"
  438. };
  439.  
  440. resource 'ics#' (rMoofIcon, purgeable) {
  441.     {
  442. /* [1] */
  443.         $"24C0 2D21 5613 860D F1FB 10F2 2C02 4C03"
  444.         $"2BF2 1A0A 0A0A 161A 192C 00C0",
  445. /* [2] */
  446.         $"24C0 2DE1 7FF3 FFFF FFFF 1FFE 3FFE 7FFF"
  447.         $"3FFE 1FFE 0FFE 1FFE 19EC 00C0"
  448.     }
  449. };
  450.  
  451. resource 'ics#' (rSndDocIcon, purgeable) {
  452.     {
  453. /* [1] */
  454.         $"0000 FFFC 8006 8007 8081 8191 8289 84A5"
  455.         $"B895 A095 B895 BCA5 8689 8391 8181 FFFF",
  456. /* [2] */
  457.         $"0000 FFFC FFFE FFFF FFFF FFFF FFFF FFFF"
  458.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  459.     }
  460. };
  461.  
  462. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  463.  These are the resources used for an emergency exit alert. */
  464.  
  465. resource 'ALRT' (rExitAlert, "Exit alert", purgeable) {
  466.     {0, 0, kExitAlertSizeH, kExitAlertSizeW}, rExitAlert,
  467.     {
  468. /* [1] */ OK, visible, silent,
  469. /* [2] */ OK, visible, silent,
  470. /* [3] */ OK, visible, silent,
  471. /* [4] */ OK, visible, silent
  472.     },
  473.     alertPositionMainScreen
  474. };
  475.  
  476. resource 'DITL' (rExitAlert, "Exit alert", purgeable) {
  477.     {
  478. /* [1] */    {    kExitAlertSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  479.                 kExitAlertSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  480.                 kExitAlertSizeH - kStandardWhiteSpacing,                /* bottom */
  481.                 kExitAlertSizeW - kStandardWhiteSpacing                    /* right */
  482.             }, Button {enabled, "OK"},
  483. /* [2] */    kStdAlertIconRect, Icon {disabled, rCautionIcon},
  484. /* [3] */    {    kStandardWhiteSpacing,
  485.                 kStdAlertIconLeft + kIconWidthOrHeight + kStandardWhiteSpacing,
  486.                 kStandardWhiteSpacing + kIconWidthOrHeight,
  487.                 kExitAlertSizeW - kStandardWhiteSpacing
  488.             }, StaticText {disabled, "Sorry, an unrecoverable error has occurred!"},
  489. /* [4] */    {    kStandardWhiteSpacing + kIconWidthOrHeight + kStandardWhiteSpacing,
  490.                 kStandardWhiteSpacing,
  491.                 kExitAlertSizeH - (kButtonSizeH + (2 * kStandardWhiteSpacing)),
  492.                 kExitAlertSizeW - kStandardWhiteSpacing
  493.             }, StaticText {disabled, "^0"}
  494.     }
  495. };
  496.  
  497. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  498.  These are the resources used to display error messages to the user. */
  499.  
  500. resource 'ALRT' (rUserAlert, "Error alert", purgeable) {
  501.     {0, 0, kUserAlertSizeH, kUserAlertSizeW}, rUserAlert,
  502.     {
  503. /* [1] */ OK, visible, silent,
  504. /* [2] */ OK, visible, silent,
  505. /* [3] */ OK, visible, silent,
  506. /* [4] */ OK, visible, silent
  507.     },
  508.     alertPositionMainScreen
  509. };
  510.  
  511. resource 'DITL' (rUserAlert, "Error alert", purgeable) {
  512.     {
  513. /* [1] */    {    kUserAlertSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  514.                 kUserAlertSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  515.                 kUserAlertSizeH - kStandardWhiteSpacing,                /* bottom */
  516.                 kUserAlertSizeW - kStandardWhiteSpacing                    /* right */
  517.             }, Button {enabled, "OK"},
  518. /* [2] */    {    kStandardWhiteSpacing,
  519.                 kStdAlertIconLeft + kIconWidthOrHeight + kStandardWhiteSpacing,
  520.                 kUserAlertSizeH - kStandardWhiteSpacing - kStandardWhiteSpacing - kButtonSizeH,
  521.                 kUserAlertSizeW - kStandardWhiteSpacing
  522.             }, StaticText {disabled, "^0\n(error = ^1)"},
  523. /* [3] */    kStdAlertIconRect, Icon {disabled, rCautionIcon}
  524.     }
  525. };
  526.  
  527. /* These are the strings used for error messages. */
  528. resource 'STR#' (sErrStrings, "Error alert", purgeable) {
  529.     {
  530.     "An error has occurred.";
  531.     "A Memory Manager error has occurred.";
  532.     "A Resource Manager error has occurred.";
  533.     "That file is currently open and cannot be used.";
  534.     "The wave table synthesizer is not available.";
  535.     "This system does not support the Sound Manager; use System 7.0 or later.";
  536.     "Memory is too low to continue.  Try closing a window or increasing the SIZE resource.";
  537.     "Could not find application’s menu resources.";
  538.     "Could not initialize the Sound unit.";
  539.     "The Sound Manager has encountered an error.";
  540.     "Could not create a new document.";
  541.     "Error initializing the status window.";
  542.     "Could not complete the edit command.";
  543.     "There is a problem with this document.";
  544.     }
  545. };
  546.  
  547. /* These are a set of strings used to report Sound Manager errors.  Instead of
  548.  the error number, one of these strings will be used.  These are only the set
  549.  of Sound Manager errors.  The equation to be used to include additional strings
  550.  is the Sound Manager ABS(error) + noHardware) + 1.  200 is the first Sound Manager
  551.  error number and 1 is the index, since GetIndString is 1 based. */
  552.  
  553. resource 'STR#' (sSMErrStrings, "Error alert", purgeable) {
  554.     {
  555.     "no hardware available";                    /* noHardware -200 */
  556.     "not enough hardware available";            /* notEnoughHardware -201 */
  557.     "";                                            /* not used -202 */
  558.     "sound channel queue is full";                /* queueFull -203 */
  559.     "problem with resource";                    /* resProblem -204 */
  560.     "bad sound channel";                        /* badChannel -205 */
  561.     "bad sound format";                            /* badFormat -206 */
  562.     "could not allocate enough memory";            /* notEnoughBufferSpace -207 */
  563.     "was not type AIFF or was of bad format";    /* badFileFormat -208 */
  564.     "the Channel is being used";                /* channelBusy -209 */
  565.     "can not operate in the memory allowed";    /* buffersTooSmall -210 */
  566.     "the channel is not busy";                    /* channelNotBusy -211 */
  567.     "not enought CPU cycles left";                /* noMoreRealTime -212 */
  568.     "";                                            /* not used -213 */
  569.     "";                                            /* not used -214 */
  570.     "";                                            /* not used -215 */
  571.     "";                                            /* not used -216 */
  572.     "";                                            /* not used -217 */
  573.     "";                                            /* not used -218 */
  574.     "";                                            /* not used -219 */
  575.     "sound input hardware not available";        /* siNoSoundInHardware -220 */
  576.     "invalid index";                             /* siBadSoundInDevice -221 */
  577.     "nil buffer passed";                         /* siNoBufferSpecified -222 */
  578.     "invalid compression type";                    /* siInvalidCompression -223 */
  579.     "hard drive too slow to record to disk";    /* siHardDriveTooSlow -224 */
  580.     "invalid sample rate";                        /* siInvalidSampleRate -225 */
  581.     "invalid sample size";                        /* siInvalidSampleSize -226 */
  582.     "input device already in use";                /* siDeviceBusyErr -227 */
  583.     "input device could not be opened";            /* siBadDeviceName -228 */
  584.     "invalid input device reference number";    /* siBadRefNum -229 */
  585.     "input device hardware failure";            /* siInputDeviceErr -230 */
  586.     "invalid info type selector";                /* siUnknownInfoType -231 */
  587.     "invalid quality selector";                    /* siUnknownQuality -232 */
  588.     }
  589. };
  590.  
  591. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  592.  These are the resources used to tell the user about the sound volume. */
  593.  
  594. resource 'ALRT' (rSoundVol, "Volume alert", purgeable) {
  595.     {0, 0, kSoundVolSizeH, kSoundVolSizeW}, rSoundVol,
  596.     {
  597. /* [1] */ OK, visible, sound1,
  598. /* [2] */ OK, visible, sound1,
  599. /* [3] */ OK, visible, sound1,
  600. /* [4] */ OK, visible, sound1
  601.     },
  602.     alertPositionMainScreen
  603. };
  604.  
  605. resource 'DITL' (rSoundVol, "Volume alert", purgeable) {
  606.     {
  607. /* [1] */    {    kSoundVolSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  608.                 kSoundVolSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  609.                 kSoundVolSizeH - kStandardWhiteSpacing,                    /* bottom */
  610.                 kSoundVolSizeW - kStandardWhiteSpacing                    /* right */
  611.             }, Button {enabled, "OK"},
  612. /* [2] */    {    kStandardWhiteSpacing,
  613.                 kStdAlertIconLeft + kIconWidthOrHeight + kStandardWhiteSpacing,
  614.                 kSoundVolSizeH - kStandardWhiteSpacing - kStandardWhiteSpacing - kButtonSizeH,
  615.                 kSoundVolSizeW - kStandardWhiteSpacing
  616.             }, StaticText {disabled,
  617.                 "The sound volume is ^0%.  Use the Control Panel if you wish to adjust this."},
  618. /* [3] */    kStdAlertIconRect, Icon {disabled, rNoteIcon}
  619.     }
  620. };
  621.  
  622.  
  623. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  624.  These are the resources for my name this sound dialog. */
  625.  
  626. resource 'DLOG' (rGetNameDLOG, "Name sound", purgeable) {
  627.     {0, 0, kGetNameDialogSizeH, kGetNameDialogSizeW},
  628.     dBoxProc, visible, noGoAway, 0, rGetNameDLOG, "", alertPositionMainScreen
  629. };
  630.  
  631. resource 'DITL' (rGetNameDLOG, "Name sound", purgeable) {
  632.     {
  633. /* [1] */    {    kGetNameDialogSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  634.                 kGetNameDialogSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  635.                 kGetNameDialogSizeH - kStandardWhiteSpacing,                /* bottom */
  636.                 kGetNameDialogSizeW - kStandardWhiteSpacing                    /* right */
  637.             }, Button {enabled, "OK"},
  638. /* [2] */    {    kGetNameDialogSizeH - kStandardWhiteSpacing - kButtonSizeH,            /* top */
  639.                 kGetNameDialogSizeW - (2 * (kStandardWhiteSpacing + kButtonSizeW)),    /* left */
  640.                 kGetNameDialogSizeH - kStandardWhiteSpacing,                        /* bottom */
  641.                 kGetNameDialogSizeW - (kButtonSizeW + (2 * kStandardWhiteSpacing))    /* right */
  642.             }, Button {enabled, "Cancel"},
  643. /* [3] */    {    kStandardWhiteSpacing + kStandardTextHeight + kStandardWhiteSpacing,
  644.                 kStandardWhiteSpacing,
  645.                 kStandardWhiteSpacing + kStandardTextHeight + kStandardWhiteSpacing + kStandardTextHeight,
  646.                 kGetNameDialogSizeW - kStandardWhiteSpacing
  647.             }, EditText {enabled, ""},
  648. /* [4] */    {    kStandardWhiteSpacing,
  649.                 kStandardWhiteSpacing,
  650.                 kStandardWhiteSpacing + 16,
  651.                 kGetNameDialogSizeW - kStandardWhiteSpacing
  652.             }, StaticText {disabled, "Please name this sound..."},
  653. /* [5] */    {0, 0, 0, 0}, UserItem {disabled},
  654.     }
  655. };
  656.  
  657.  
  658. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  659.  These are the resources for my custom Standard File dialog. */
  660.  
  661. resource 'DLOG' (rCustomGetFileDLOG, "Get file", purgeable) {
  662.     {0, 0, 198, 344},
  663.     dBoxProc, invisible, noGoAway, 0, rCustomGetFileDLOG, "", alertPositionMainScreen
  664. };
  665.  
  666. resource 'DITL' (rCustomGetFileDLOG, "Get file", purgeable) {
  667.     {
  668. /* [1] */    {135, 252, 155, 332}, Button {enabled, "Open"},
  669. /* [2] */    {104, 252, 124, 332}, Button {enabled, "Cancel"},
  670. /* [3] */    {0, 0, 0, 0}, HelpItem {disabled, HMScanhdlg {-6042}},
  671. /* [4] */    {8, 235, 24, 337}, UserItem {enabled},
  672. /* [5] */    {32, 252, 52, 332}, Button {enabled, "Eject"},
  673. /* [6] */    {60, 252, 80, 332},    Button {enabled, "Desktop"},
  674. /* [7] */    {29, 12, 159, 230},    UserItem {enabled},
  675. /* [8] */    {6, 12, 25, 230}, UserItem {enabled},
  676. /* [9] */    {91, 251, 92, 333},    Picture {disabled, 11},
  677. /* [10] */    {169, 13, 185, 285}, CheckBox {enabled, "Show only files with sound resources"}
  678.     }
  679. };
  680.  
  681. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  682.  We use an MBAR resource to conveniently load all the menus */
  683.  
  684. resource 'MBAR' (rMenuBar, preload) {
  685.     {mApple, mFile, mEdit, mDemos};
  686. };
  687.  
  688. resource 'MENU' (mApple, preload) { /* Disable dashed line, enable About and DAs */
  689.     mApple, textMenuProc, (AllItems & ~MenuItem2), enabled, apple,
  690.     {
  691.         "About SoundApp…", noicon, nokey, nomark, plain;
  692.         "-", noicon, nokey, nomark, plain
  693.     }
  694. };
  695.  
  696. resource 'MENU' (mFile, preload) { /* enable Quit and Open only, program enables others */
  697.     mFile, textMenuProc, (NoItems | MenuItem1 | MenuItem2 | MenuItem12), enabled, "File",
  698.     {
  699.         "New", noicon, "N", nomark, plain;
  700.         "Open…", noicon, "O", nomark, plain;
  701.         "-", noicon, nokey, nomark, plain;
  702.         "Close", noicon, "W", nomark, plain;
  703.         "Save", noicon, "S", nomark, plain;
  704.         "Save As…", noicon, nokey, nomark, plain;
  705.         "Revert", noicon, nokey, nomark, plain;
  706.         "-", noicon, nokey, nomark, plain;
  707.         "Page Setup…", noicon, nokey, nomark, plain;
  708.         "Print…", noicon, nokey, nomark, plain;
  709.         "-", noicon, nokey, nomark, plain;
  710.         "Quit", noicon, "Q", nomark, plain
  711.     }
  712. };
  713.  
  714. resource 'MENU' (mEdit, preload) { /* disable everything, program does the enabling */
  715.     mEdit, textMenuProc, NoItems, enabled, "Edit",
  716.     {
  717.         "Undo", noicon, "Z", nomark, plain;
  718.         "-", noicon, nokey, nomark, plain;
  719.         "Cut", noicon, "X", nomark, plain;
  720.         "Copy", noicon, "C", nomark, plain;
  721.         "Paste", noicon, "V", nomark, plain;
  722.         "Clear", noicon, "B", nomark, plain
  723.     }
  724. };
  725.  
  726. resource 'MENU' (mDemos, preload) { /* enable everything except the dashed lines */
  727.     mDemos, textMenuProc, (AllItems), enabled, "Demos",
  728.     {
  729.         "Check Volume...", noicon, nokey, nomark, plain;
  730.         "-", noicon, nokey, nomark, plain;
  731.         "Square Wave Scale", noicon, nokey, nomark, plain;
  732.         "Square Wave Melody", noicon, nokey, nomark, plain;
  733.         "Square Wave Timbres", noicon, nokey, nomark, plain;
  734.         "-", noicon, nokey, nomark, plain;
  735.         "Wave Table Scale", noicon, nokey, nomark, plain;
  736.         "Wave Table Melody", noicon, nokey, nomark, plain;
  737.         "Wave Table Counterpoint", noicon, nokey, nomark, plain;
  738.         "-", noicon, nokey, nomark, plain;
  739.         "Sample Sound Melody", noicon, nokey, nomark, plain;
  740.         "Sample Sound Counterpoint", noicon, nokey, nomark, plain;
  741.     }
  742. };
  743.  
  744. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  745.  The quintessential MultiFinder friendliness device, the SIZE resource */
  746.  
  747. resource 'SIZE' (-1, purgeable) {
  748.     dontSaveScreen,
  749.     acceptSuspendResumeEvents,
  750.     enableOptionSwitch,
  751.     canBackground,                    /* we can background, but we don’t */
  752.     multiFinderAware,                /* we do our own activate/deactivate */
  753.     backgroundAndForeground,        /* this is not a background-only application! */
  754.     dontGetFrontClicks,                /* standard, don’t want front clicks */
  755.     ignoreChildDiedEvents,            /* I’m not a debugger and I don’t sub-launch */
  756.     is32BitCompatible,                /* this is a 32 bit clean application */
  757.     isHighLevelEventAware,            /* I use AppleEvents */
  758.     onlyLocalHLEvents,
  759.     notStationeryAware,
  760.     dontUseTextEditServices,
  761.     reserved, reserved, reserved,
  762.     kPrefSize * 1024,
  763.     kMinSize * 1024
  764. };
  765.  
  766. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  767.  This is the prompt string that appears in the SFPutFile dialog. */\
  768.  
  769. resource 'STR ' (rPutFileMsg, "Put file", purgeable) {
  770.     "Create a new file named…"
  771. };
  772.  
  773. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  774.  These are the resources used for the application’s about window.
  775.  The ICON is copied from the bundle resource’s ICN#.  The cicn is also
  776.  based on that.
  777.  
  778.  VERSION 1.2: Removed the 'cicn' resource, and uses PlotIconID. */
  779.  
  780. resource 'WIND' (rAboutWindow, "About dialog", purgeable) {
  781.     {0, 0, kAboutWindowSizeH, kAboutWindowSizeW},
  782.     altDBoxProc, visible, noGoAway, 0, "", alertPositionMainScreen
  783. };
  784.  
  785. resource 'CNTL' (rAboutOKCntl, "About dialog", purgeable) {
  786.     {
  787.         kAboutWindowSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  788.         kAboutWindowSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  789.         kAboutWindowSizeH - kStandardWhiteSpacing,                    /* bottom */
  790.         kAboutWindowSizeW - kStandardWhiteSpacing                    /* right */
  791.     }, 0, visible, 0, 0, pushButProc, 0, "OK"
  792. };
  793.  
  794. resource 'STR ' (rAboutText, "About dialog", purgeable) {
  795.     "“^0” version ^1\n"
  796.     "A sample application using the Sound Manager.\n\n"
  797.     "Brought to you by Jim Reekes\n"
  798.     "Copyright © 1989-94 Apple Computer\n\n"
  799.     "We’d go Moof!™ for you, but Vince won’t let us."
  800. };
  801.  
  802. resource 'PICT' (rAppPict, "About dialog", purgeable) {
  803.     3396, {110, 108, 151, 350},
  804.     $"0011 02FF 0C00 FFFF FFFF 006C 0000 006E 0000 015E 0000 0097 0000 0000 0000 001E"
  805.     $"0001 000A 006E 006C 0097 015E 0099 80FA 006E 006C 0097 0165 0000 0000 0000 0000"
  806.     $"0048 0000 0048 0000 0000 0008 0001 0008 0000 0000 0000 1F10 0000 0000 0000 0791"
  807.     $"8000 00FF 0800 FFFF FFFF FFFF 0800 FFFF FFFF CCCC 0800 FFFF FFFF 9999 0800 FFFF"
  808.     $"FFFF 6666 0800 FFFF FFFF 3333 0800 FFFF FFFF 0000 0800 FFFF CCCC FFFF 0800 FFFF"
  809.     $"CCCC CCCC 0800 FFFF CCCC 9999 0800 FFFF CCCC 6666 0800 FFFF CCCC 3333 0800 FFFF"
  810.     $"CCCC 0000 0800 FFFF 9999 FFFF 0800 FFFF 9999 CCCC 0800 FFFF 9999 9999 0800 FFFF"
  811.     $"9999 6666 0800 FFFF 9999 3333 0800 FFFF 9999 0000 0800 FFFF 6666 FFFF 0800 FFFF"
  812.     $"6666 CCCC 0800 FFFF 6666 9999 0800 FFFF 6666 6666 0800 FFFF 6666 3333 0800 FFFF"
  813.     $"6666 0000 0800 FFFF 3333 FFFF 0800 FFFF 3333 CCCC 0800 FFFF 3333 9999 0800 FFFF"
  814.     $"3333 6666 0800 FFFF 3333 3333 0800 FFFF 3333 0000 0800 FFFF 0000 FFFF 0800 FFFF"
  815.     $"0000 CCCC 0800 FFFF 0000 9999 0800 FFFF 0000 6666 0800 FFFF 0000 3333 0800 FFFF"
  816.     $"0000 0000 0800 CCCC FFFF FFFF 0800 CCCC FFFF CCCC 0800 CCCC FFFF 9999 0800 CCCC"
  817.     $"FFFF 6666 0800 CCCC FFFF 3333 0800 CCCC FFFF 0000 0800 CCCC CCCC FFFF 0800 CCCC"
  818.     $"CCCC CCCC 0800 CCCC CCCC 9999 0800 CCCC CCCC 6666 0800 CCCC CCCC 3333 0800 CCCC"
  819.     $"CCCC 0000 0800 CCCC 9999 FFFF 0800 CCCC 9999 CCCC 0800 CCCC 9999 9999 0800 CCCC"
  820.     $"9999 6666 0800 CCCC 9999 3333 0800 CCCC 9999 0000 0800 CCCC 6666 FFFF 0800 CCCC"
  821.     $"6666 CCCC 0800 CCCC 6666 9999 0800 CCCC 6666 6666 0800 CCCC 6666 3333 0800 CCCC"
  822.     $"6666 0000 0800 CCCC 3333 FFFF 0800 CCCC 3333 CCCC 0800 CCCC 3333 9999 0800 CCCC"
  823.     $"3333 6666 0800 CCCC 3333 3333 0800 CCCC 3333 0000 0800 CCCC 0000 FFFF 0800 CCCC"
  824.     $"0000 CCCC 0800 CCCC 0000 9999 0800 CCCC 0000 6666 0800 CCCC 0000 3333 0800 CCCC"
  825.     $"0000 0000 0800 9999 FFFF FFFF 0800 9999 FFFF CCCC 0800 9999 FFFF 9999 0800 9999"
  826.     $"FFFF 6666 0800 9999 FFFF 3333 0800 9999 FFFF 0000 0800 9999 CCCC FFFF 0800 9999"
  827.     $"CCCC CCCC 0800 9999 CCCC 9999 0800 9999 CCCC 6666 0800 9999 CCCC 3333 0800 9999"
  828.     $"CCCC 0000 0800 9999 9999 FFFF 0800 9999 9999 CCCC 0800 9999 9999 9999 0800 9999"
  829.     $"9999 6666 0800 9999 9999 3333 0800 9999 9999 0000 0800 9999 6666 FFFF 0800 9999"
  830.     $"6666 CCCC 0800 9999 6666 9999 0800 9999 6666 6666 0800 9999 6666 3333 0800 9999"
  831.     $"6666 0000 0800 9999 3333 FFFF 0800 9999 3333 CCCC 0800 9999 3333 9999 0800 9999"
  832.     $"3333 6666 0800 9999 3333 3333 0800 9999 3333 0000 0800 9999 0000 FFFF 0800 9999"
  833.     $"0000 CCCC 0800 9999 0000 9999 0800 9999 0000 6666 0800 9999 0000 3333 0800 9999"
  834.     $"0000 0000 0800 6666 FFFF FFFF 0800 6666 FFFF CCCC 0800 6666 FFFF 9999 0800 6666"
  835.     $"FFFF 6666 0800 6666 FFFF 3333 0800 6666 FFFF 0000 0800 6666 CCCC FFFF 0800 6666"
  836.     $"CCCC CCCC 0800 6666 CCCC 9999 0800 6666 CCCC 6666 0800 6666 CCCC 3333 0800 6666"
  837.     $"CCCC 0000 0800 6666 9999 FFFF 0800 6666 9999 CCCC 0800 6666 9999 9999 0800 6666"
  838.     $"9999 6666 0800 6666 9999 3333 0800 6666 9999 0000 0800 6666 6666 FFFF 0800 6666"
  839.     $"6666 CCCC 0800 6666 6666 9999 0800 6666 6666 6666 0800 6666 6666 3333 0800 6666"
  840.     $"6666 0000 0800 6666 3333 FFFF 0800 6666 3333 CCCC 0800 6666 3333 9999 0800 6666"
  841.     $"3333 6666 0800 6666 3333 3333 0800 6666 3333 0000 0800 6666 0000 FFFF 0800 6666"
  842.     $"0000 CCCC 0800 6666 0000 9999 0800 6666 0000 6666 0800 6666 0000 3333 0800 6666"
  843.     $"0000 0000 0800 3333 FFFF FFFF 0800 3333 FFFF CCCC 0800 3333 FFFF 9999 0800 3333"
  844.     $"FFFF 6666 0800 3333 FFFF 3333 0800 3333 FFFF 0000 0800 3333 CCCC FFFF 0800 3333"
  845.     $"CCCC CCCC 0800 3333 CCCC 9999 0800 3333 CCCC 6666 0800 3333 CCCC 3333 0800 3333"
  846.     $"CCCC 0000 0800 3333 9999 FFFF 0800 3333 9999 CCCC 0800 3333 9999 9999 0800 3333"
  847.     $"9999 6666 0800 3333 9999 3333 0800 3333 9999 0000 0800 3333 6666 FFFF 0800 3333"
  848.     $"6666 CCCC 0800 3333 6666 9999 0800 3333 6666 6666 0800 3333 6666 3333 0800 3333"
  849.     $"6666 0000 0800 3333 3333 FFFF 0800 3333 3333 CCCC 0800 3333 3333 9999 0800 3333"
  850.     $"3333 6666 0800 3333 3333 3333 0800 3333 3333 0000 0800 3333 0000 FFFF 0800 3333"
  851.     $"0000 CCCC 0800 3333 0000 9999 0800 3333 0000 6666 0800 3333 0000 3333 0800 3333"
  852.     $"0000 0000 0800 0000 FFFF FFFF 0800 0000 FFFF CCCC 0800 0000 FFFF 9999 0800 0000"
  853.     $"FFFF 6666 0800 0000 FFFF 3333 0800 0000 FFFF 0000 0800 0000 CCCC FFFF 0800 0000"
  854.     $"CCCC CCCC 0800 0000 CCCC 9999 0800 0000 CCCC 6666 0800 0000 CCCC 3333 0800 0000"
  855.     $"CCCC 0000 0800 0000 9999 FFFF 0800 0000 9999 CCCC 0800 0000 9999 9999 0800 0000"
  856.     $"9999 6666 0800 0000 9999 3333 0800 0000 9999 0000 0800 0000 6666 FFFF 0800 0000"
  857.     $"6666 CCCC 0800 0000 6666 9999 0800 0000 6666 6666 0800 0000 6666 3333 0800 0000"
  858.     $"6666 0000 0800 0000 3333 FFFF 0800 0000 3333 CCCC 0800 0000 3333 9999 0800 0000"
  859.     $"3333 6666 0800 0000 3333 3333 0800 0000 3333 0000 0800 0000 0000 FFFF 0800 0000"
  860.     $"0000 CCCC 0800 0000 0000 9999 0800 0000 0000 6666 0800 0000 0000 3333 0800 EEEE"
  861.     $"0000 0000 0800 DDDD 0000 0000 0800 BBBB 0000 0000 0800 AAAA 0000 0000 0800 8888"
  862.     $"0000 0000 0800 7777 0000 0000 0800 5555 0000 0000 0800 4444 0000 0000 0800 2222"
  863.     $"0000 0000 0800 1111 0000 0000 0800 0000 EEEE 0000 0800 0000 DDDD 0000 0800 0000"
  864.     $"BBBB 0000 0800 0000 AAAA 0000 0800 0000 8888 0000 2000 AAAA AAAA AAAA 2000 DDDD"
  865.     $"DDDD DDDD 2000 0000 0000 1111 2000 0000 0000 4444 2000 0000 0000 7777 2000 0000"
  866.     $"0000 AAAA 2000 0000 0000 DDDD 2000 0000 1111 0000 2000 0000 4444 0000 2000 0003"
  867.     $"D0D7 0001 2000 1111 1111 1111 2000 2222 2222 2222 2000 4444 4444 4444 2000 5555"
  868.     $"5555 5555 2000 7777 7777 7777 2000 8888 8888 8888 2000 BBBB BBBB BBBB 2000 EEEE"
  869.     $"EEEE EEEE 2000 0000 0000 2222 2000 0000 0000 5555 2000 0000 0000 8888 2000 0000"
  870.     $"0000 BBBB 2000 0000 0000 EEEE 2000 0000 2222 0000 2000 0000 5555 0000 0800 0000"
  871.     $"0000 0000 006E 006C 0097 015E 006E 006C 0097 015E 0000 000A 006E 006C 0097 015E"
  872.     $"0481 0087 0004 8100 8700 0481 0087 0004 8100 8700 08F9 0081 FF9E FFF2 000C F900"
  873.     $"00FF 81EF A0EF 00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 000C F900 00FF 81EF A0EF"
  874.     $"00FF F200 0FF9 0000 FF8B EF01 0000 98EF 00FF F200 17F9 0000 FFD5 EF01 0000 BBEF"
  875.     $"FD00 F1EF FE00 ABEF 00FF F200 16F9 0000 FFDD EFF8 00B9 EFFD 00F1 EFFE 00AC EF00"
  876.     $"FFF2 001A F900 00FF DEEF FD00 FEEF FE00 B9EF FD00 F1EF FD00 ADEF 00FF F200 1BF9"
  877.     $"0000 FFE0 EFFC 00FD EF01 0000 B8EF FD00 F1EF FC00 AEEF 00FF F200 36F9 0000 FFE1"
  878.     $"EFFC 00FD EFFE 00F7 EFFB 00F7 EFFD 00FE EFFC 00F7 EF02 0000 EFFC 00F5 EFF8 00F1"
  879.     $"EFFB 00F4 EFF9 00F5 EFF9 00D8 EF00 FFF2 0037 F900 00FF E3EF FB00 F2EF F700 F9EF"
  880.     $"FD00 FDEF FD00 F8EF F700 F7EF FD00 01EF EFFC 00F1 EFFB 00F5 EFF5 00F8 EFFD 0000"
  881.     $"EFFB 00DB EF00 FFF2 0047 F900 00FF E3EF FC00 F3EF FD00 FEEF FD00 F9EF FC00 FEEF"
  882.     $"FC00 F9EF FC00 01EF EFFC 00F9 EFFC 00FE EFFC 00F2 EF02 0000 EFFD 00F6 EFFD 00FD"
  883.     $"EFFD 00F9 EFFC 00FE EFFC 00DC EF00 FFF2 0047 F900 00FF E3EF FA00 F6EF FD00 FDEF"
  884.     $"FD00 F9EF FD00 FDEF FD00 F8EF FD00 FDEF FD00 F9EF FD00 FDEF FC00 F2EF 0300 00EF"
  885.     $"EFFD 00F7 EFFC 00FD EFFC 00FA EFFC 00FE EFFB 00DE EF00 FFF2 0047 F900 00FF E2EF"
  886.     $"FA00 F8EF FD00 FDEF FC00 FAEF FC00 FEEF FC00 F8EF FD00 FDEF FD00 F9EF FD00 FCEF"
  887.     $"FD00 F2EF 0100 00FE EFFD 00F6 EFFD 00FC EFFC 00FB EFFC 00FC EFFC 00E0 EF00 FFF2"
  888.     $"0046 F900 00FF E2EF FA00 F9EF FD00 FDEF FC00 FAEF FC00 FDEF FD00 F8EF FC00 FEEF"
  889.     $"FC00 F9EF FD00 FCEF FD00 F2EF FE00 FEEF FD00 F7EF FC00 FCEF FD00 FAEF FC00 FCEF"
  890.     $"FC00 E1EF 00FF F200 42F9 0000 FFE1 EFFC 00F9 EFFD 00FC EFFC 00FA EFFC 00FE EFFC"
  891.     $"00F8 EFFD 00FD EFFC 00F9 EFFD 00FC EFFD 00F2 EFF6 00F7 EFFD 00FC EFFC 00FA EFFC"
  892.     $"00FC EFFC 00E2 EF00 FFF2 004B F900 00FF E9EF 0100 00FB EFFC 00FA EFFD 00FC EFFC"
  893.     $"00FA EFFC 00FD EFFC 00F8 EFFD 00FD EFFC 00F9 EFFD 00FC EFFC 00F3 EFFE 00FC EFFD"
  894.     $"00F8 EFFC 00FC EFFC 00FA EFFC 00FC EFFC 00E3 EF00 FFF2 004B F900 00FF EAEF 0100"
  895.     $"00FB EFFC 00FA EFFC 00FD EFFC 00F9 EFFC 00FD EFFD 00F7 EFFD 00FD EFFC 00F9 EFFC"
  896.     $"00FD EFFC 00F3 EFFE 00FB EFFD 00F8 EFFC 00FC EFFD 00F9 EFFB 00FD EFFC 00E4 EF00"
  897.     $"FFF2 004B F900 00FF ECEF FD00 FCEF FD00 F8EF FD00 FDEF FD00 F8EF FB00 01EF EFFB"
  898.     $"00F8 EFFC 00FD EFFC 00F9 EFFC 00FD EFFC 00F3 EFFE 00FA EFFD 00F8 EFFC 00FD EFFC"
  899.     $"00F9 EFFB 00FE EFFC 00E4 EF00 FFF2 0040 F900 00FF EDEF FD00 FDEF FC00 F7EF F700"
  900.     $"F5EF F400 F9EF FB00 FEEF FC00 F7EF F200 F5EF FE00 FAEF FB00 FAEF FA00 01EF EFFD"
  901.     $"00F7 EFFA 0001 EFEF FD00 E4EF 00FF F200 3BF9 0000 FFEB EFF8 00F4 EFFA 00F2 EFFC"
  902.     $"0000 EFF9 00FB EFFA 0000 EFF9 00F7 EFFB 0001 EFEF FE00 F3EF FC00 FDEF F800 FBEF"
  903.     $"F700 F4EF F600 E3EF 00FF F200 14F9 0000 FF81 EFDF EFFB 00EF EFFC 00DF EF00 FFF2"
  904.     $"0014 F900 00FF 81EF DEEF FC00 EEEF FC00 E0EF 00FF F200 14F9 0000 FF81 EFDE EFFB"
  905.     $"00EE EFFC 00E1 EF00 FFF2 0014 F900 00FF 81EF DDEF FC00 EDEF FC00 E2EF 00FF F200"
  906.     $"14F9 0000 FF81 EFDC EFFB 00EE EFFB 00E4 EF00 FFF2 0014 F900 00FF 81EF DBEF FA00"
  907.     $"EFEF FA00 E6EF 00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 000C F900 00FF 81EF A0EF"
  908.     $"00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 0008 F900 81FF 9EFF F200 0481 0087 0004"
  909.     $"8100 8700 0481 0087 0004 8100 8700 0481 0087 0004 8100 8700 00FF"
  910. };
  911.  
  912.  
  913. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  914.  These are the resources used used for the sound status window. */
  915.  
  916. resource 'WIND' (rStatusWindow, "Status dialog", purgeable) {
  917.     {0, 0, kStatusWindowSizeH, kStatusWindowSizeW},
  918.     documentProc, invisible, noGoAway, 0, "Sound Status", centerMainScreen
  919. };
  920.  
  921. resource 'CNTL' (rCancelCntl, "Status dialog", purgeable) {
  922.     {    kStatusWindowSizeH - kStandardWhiteSpacing - kButtonSizeH,    /* top */
  923.         kStatusWindowSizeW - kStandardWhiteSpacing - kButtonSizeW,    /* left */
  924.         kStatusWindowSizeH - kStandardWhiteSpacing,                    /* bottom */
  925.         kStatusWindowSizeW - kStandardWhiteSpacing                    /* right */
  926.     }, 0, visible, 0, 0, pushButProc, 0, "Stop"
  927. };
  928.  
  929. resource 'STR#' (sMessStrings, "Status dialog", purgeable) {
  930.     {
  931.     "Playing the sound asynchronously.";
  932.     "Playing the sound asynchronously resampled to middle C.";
  933.     "Playing a C major scale.";
  934.     "Playing “Promenade” from Pictures At An Exhibition, by Mussorgsky.";
  935.     "Playing middle C with the various timbres.";
  936.     "Playing “Schaut, ihr Sünder” by Löwenstern, arranged by JS Bach.";
  937.     }
  938. };
  939.  
  940. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  941.  These are the resources used for the sound document window.  This includes
  942.  a string resource that is the name given to an untitled sound resource
  943.  to appear in the list. */
  944.  
  945. resource 'WIND' (rSoundWindow, "Document window", purgeable) {
  946.     {0, 0, kSoundWindowSizeH, kSoundWindowSizeW},
  947.     documentProc, invisible, goAway, 0, "", noAutoCenter
  948. };
  949.  
  950. /* This rectangle is the position of the list in the document window.  The rectangle
  951.    is the size of the WIND inset by kStandardWhiteSpacing and to the left of the buttons. */
  952. resource 'RECT' (rListRectID, "Document window", purgeable) {
  953.     {
  954.     kStandardWhiteSpacing,
  955.     kStandardWhiteSpacing,
  956.     (kSoundWindowSizeH - kStandardWhiteSpacing),
  957.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing - kSndListButGap)}
  958. };
  959.  
  960. /* [1] */
  961. resource 'CNTL' (rPlaySndCntl, "Document window", purgeable) {
  962.     {
  963.     ((1 * kStandardWhiteSpacing) + (1 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  964.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  965.     ((1 * kStandardWhiteSpacing) + (1 * kSndButtonSizeH)),                    /* bottom */
  966.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  967.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Play Sound"
  968. };
  969.  
  970. /* [2] */
  971. resource 'CNTL' (rHyperPlayCntl, "Document window", purgeable) {
  972.     {
  973.     ((2 * kStandardWhiteSpacing) + (2 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  974.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  975.     ((2 * kStandardWhiteSpacing) + (2 * kSndButtonSizeH)),                    /* bottom */
  976.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  977.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Hyper Play"
  978. };
  979.  
  980. /* [3] */
  981. resource 'CNTL' (rPlayScaleCntl, "Document window", purgeable) {
  982.     {
  983.     ((3 * kStandardWhiteSpacing) + (3 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  984.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  985.     ((3 * kStandardWhiteSpacing) + (3 * kSndButtonSizeH)),                    /* bottom */
  986.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  987.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Play Scale"
  988. };
  989.  
  990. /* [4] */
  991. resource 'CNTL' (rPlayMelodyCntl, "Document window", purgeable) {
  992.     {
  993.     ((4 * kStandardWhiteSpacing) + (4 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  994.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  995.     ((4 * kStandardWhiteSpacing) + (4 * kSndButtonSizeH)),                    /* bottom */
  996.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  997.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Play Melody"
  998. };
  999.  
  1000. /* [5] */
  1001. resource 'CNTL' (rStopCntl, "Document window", purgeable) {
  1002.     {
  1003.     ((5 * kStandardWhiteSpacing) + (5 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  1004.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  1005.     ((5 * kStandardWhiteSpacing) + (5 * kSndButtonSizeH)),                    /* bottom */
  1006.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  1007.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Stop Sound"
  1008. };
  1009.  
  1010. /* [6] */
  1011. resource 'CNTL' (rRecordCntl, "Document window", purgeable) {
  1012.     {
  1013.     ((6 * kStandardWhiteSpacing) + (6 * kSndButtonSizeH) - kSndButtonSizeH),/* top */
  1014.     (kSoundWindowSizeW - kSndButtonSizeW - kStandardWhiteSpacing),            /* left */
  1015.     ((6 * kStandardWhiteSpacing) + (6 * kSndButtonSizeH)),                    /* bottom */
  1016.     (kSoundWindowSizeW - kStandardWhiteSpacing)                                /* right */
  1017.     }, 0, visible, 0, 0, pushButProcUseWFont, 0, "Record Sound"
  1018. };
  1019.  
  1020. resource 'STR ' (rUntitled, "Document window", purgeable) {
  1021.     "<untitled>"
  1022. };
  1023.  
  1024.  
  1025.